++++++++++Add a BACK button in the index.php file++++++++++++++++++

This version of the Back Button takes people back to the category list for the product they are on.

This is useful for diverting people back to the categories who may have arrived directly on the product
from search engines (i.e. like the javascript history back option would).

This Back Button also works in ALL sub Categories.  A MUST if you have 'Categories Product Listing Mod'
installed.


Credit to PD_Steve for mostly typing this file and for some of his code.  Thanks also to Jason
Patterson for actually knowing how to code (unlike me).


Feel free to contact me should the need arise.


Henry
www.ReactiveMicro.com
hscourbis@reactivemicro.com


-------------------------------------------------------
Open catalog/index.php
-------------------------------------------------------

---Around line 111, find:---


// needed for the new products module shown below
    $new_products_category_id = $current_category_id;
?>




---Just below it add:---


<!-- [DATE MOD INSTALLED]: Added 'Back Back Button' mod code -->
<table border="0" width="100%" cellspacing="0" cellpadding="6"><td align="center"><?php
$thelen=strlen($cPath);
$ext = strrchr($cPath, '_');
if ($ext == FALSE && $cPath !== '') {
	echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . ' ">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>';
}
else {    
	$cPath=substr($cPath,0,$thelen-strlen($ext));
	echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '?cPath=' . $cPath . '">' . tep_image_button('button_back.gif',
	IMAGE_BUTTON_BACK) . '</a>';
}
?>
<!-- End of mod -->







---Around line 279, find:---


      <tr>
        <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
      </tr>




---Just below it add: (same code)---


<!-- [DATE MOD INSTALLED]: Added 'Back Back Button' mod code -->
<table border="0" width="100%" cellspacing="0" cellpadding="6"><td align="center"><?php
$thelen=strlen($cPath);
$ext = strrchr($cPath, '_');
if ($ext == FALSE && $cPath !== '') {
	echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . ' ">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>';
}
else {    
	$cPath=substr($cPath,0,$thelen-strlen($ext));
	echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '?cPath=' . $cPath . '">' . tep_image_button('button_back.gif',
	IMAGE_BUTTON_BACK) . '</a>';
}
?>
<!-- End of mod -->


-------------------------------------------------------
Finished!
-------------------------------------------------------











NOTE: Below is the code for PD_Steve's Back Button which I have used on my Site.  It works, and works well.  I would recommend it.
From contribution: add_button_back_1_2_1.zip





++++++++++Add a BACK button in the product_info++++++++++++++++++

This version of the back button takes people back to the category list for the product they are on.

This is useful for diverting people back to the categories who may have arrived directly on the product
from search engines (i.e. like the javascript history back option would).

PD_Steve

-------------------------------------------------------
Open catalog/product_info.php
-------------------------------------------------------

---Around line 227, find:---

<td class="main" align="middle"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

---just above it add:---

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($current_category_id = '')) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

-------------------------------------------------------
finished
-------------------------------------------------------